using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp;
using CKY.AgentPlatform.Application.Contracts.McpTools.Dtos;

namespace CKY.AgentPlatform.Application.Contracts.McpTools
{
    /// <summary>
    /// MCP工具应用服务接口
    /// </summary>
    [RemoteService(IsEnabled = true)]
    public interface IMcpToolAppService : IApplicationService
    {
        /// <summary>
        /// 获取MCP工具列表
        /// </summary>
        /// <param name="input">查询参数</param>
        /// <returns>工具列表</returns>
        Task<PagedResultDto<McpToolDto>> GetListAsync(GetMcpToolListInput input);

        /// <summary>
        /// 获取MCP工具详情
        /// </summary>
        /// <param name="id">工具ID</param>
        /// <returns>工具详情</returns>
        Task<McpToolDetailDto> GetAsync(Guid id);

        /// <summary>
        /// 创建MCP工具
        /// </summary>
        /// <param name="input">创建参数</param>
        /// <returns>创建的工具</returns>
        Task<McpToolDto> CreateAsync(CreateMcpToolInput input);

        /// <summary>
        /// 更新MCP工具
        /// </summary>
        /// <param name="id">工具ID</param>
        /// <param name="input">更新参数</param>
        /// <returns>更新后的工具</returns>
        Task<McpToolDto> UpdateAsync(Guid id, UpdateMcpToolInput input);

        /// <summary>
        /// 删除MCP工具
        /// </summary>
        /// <param name="id">工具ID</param>
        Task DeleteAsync(Guid id);

        /// <summary>
        /// 执行MCP工具
        /// </summary>
        /// <param name="id">工具ID</param>
        /// <param name="input">执行参数</param>
        /// <returns>执行结果</returns>
        Task<McpToolExecutionResultDto> ExecuteAsync(Guid id, ExecuteMcpToolInput input);

        /// <summary>
        /// 测试MCP工具连接
        /// </summary>
        /// <param name="id">工具ID</param>
        /// <returns>测试结果</returns>
        Task<McpToolTestResultDto> TestConnectionAsync(Guid id);

        /// <summary>
        /// 获取工具统计信息
        /// </summary>
        /// <returns>统计信息</returns>
        Task<McpToolStatisticsDto> GetStatisticsAsync();

        /// <summary>
        /// 获取工具分类列表
        /// </summary>
        /// <returns>分类列表</returns>
        Task<List<string>> GetCategoriesAsync();

        /// <summary>
        /// 重置工具统计信息
        /// </summary>
        /// <param name="id">工具ID</param>
        Task ResetStatsAsync(Guid id);

        /// <summary>
        /// 设置工具状态
        /// </summary>
        /// <param name="id">工具ID</param>
        /// <param name="status">新状态</param>
        Task SetStatusAsync(Guid id, McpToolStatus status);

        /// <summary>
        /// 批量删除工具
        /// </summary>
        /// <param name="ids">工具ID列表</param>
        Task BatchDeleteAsync(List<Guid> ids);

        /// <summary>
        /// 批量设置激活状态
        /// </summary>
        /// <param name="ids">工具ID列表</param>
        /// <param name="isActive">是否激活</param>
        Task BatchSetActiveAsync(List<Guid> ids, bool isActive);
    }
}